package com.wswy.wyjk.ui.uitls;

import com.wswy.wyjk.core.App;
import com.wswy.wyjk.model.PracticeType;
import com.wswy.wyjk.model.SubjectType;
import com.wswy.wyjk.ui.main.MineActivity;

public class PracticeTypeUtils {

    public static PracticeType getPracticeType(int type, long chapterId) {
        PracticeType practiceType = new PracticeType();
        practiceType.licenseType = App.getPracticeContext().licenseType;
        practiceType.areaCode = App.getPracticeContext().getAreaCode();
        practiceType.type = type;
        practiceType.chapterId = chapterId;
        if (MineActivity.subjectType == 0) {
            practiceType.subjectType = SubjectType.KEMU1;
        } else if (MineActivity.subjectType == 1) {
            practiceType.subjectType = SubjectType.KEMU4;
        } else {
            practiceType.subjectType = SubjectType.CERTIFICATE;
        }
        return practiceType;
    }

    public static PracticeType getPracticeType(int type) {
        PracticeType practiceType = new PracticeType();
        practiceType.licenseType = App.getPracticeContext().licenseType;
        practiceType.areaCode = App.getPracticeContext().getAreaCode();
        practiceType.type = type;
        if (MineActivity.subjectType == 0) {
            practiceType.subjectType = SubjectType.KEMU1;
        } else if (MineActivity.subjectType == 1) {
            practiceType.subjectType = SubjectType.KEMU4;
        } else {
            practiceType.subjectType = SubjectType.CERTIFICATE;
        }
        return practiceType;
    }

    public static PracticeType getPracticeType(int type, String sql) {
        PracticeType practiceType = new PracticeType();
        practiceType.licenseType = App.getPracticeContext().licenseType;
        practiceType.areaCode = App.getPracticeContext().getAreaCode();
        practiceType.type = type;
        practiceType.sql = sql;
        if (MineActivity.subjectType == 0) {
            practiceType.subjectType = SubjectType.KEMU1;
        } else if (MineActivity.subjectType == 1) {
            practiceType.subjectType = SubjectType.KEMU4;
        } else {
            practiceType.subjectType = SubjectType.CERTIFICATE;
        }
        return practiceType;
    }

    public static PracticeType getPracticeType() {
        PracticeType practiceType = new PracticeType();
        practiceType.licenseType = App.getPracticeContext().licenseType;
        practiceType.areaCode = App.getPracticeContext().getAreaCode();
        if (MineActivity.subjectType == 0) {
            practiceType.subjectType = SubjectType.KEMU1;
        } else if (MineActivity.subjectType == 1) {
            practiceType.subjectType = SubjectType.KEMU4;
        } else {
            practiceType.subjectType = SubjectType.CERTIFICATE;
        }
        return practiceType;
    }
}
